﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;

using ERPStore.Extensions;

using Microsoft.Practices.Unity;

namespace ERPStore.Tasks.Tests
{

	public sealed class Task : CodeActivity
	{
		// Define an activity input argument of type string
		public InArgument<Type> TypeArgument { get; set; }

		// If your activity returns a value, derive from CodeActivity<TResult>
		// and return the value from the Execute method.
		protected override void Execute(CodeActivityContext context)
		{
			// Obtain the runtime value of the Text input argument
			var t = context.GetValue(this.TypeArgument);

			var container = global::ERPStore.GlobalConfiguration.Configuration.DependencyResolver.GetContainer();
			var job = (Dummy)container.Resolve(t);

			job.DoSomething();

		}
	}
}
